﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VoteUphold
{

    /// <summary>
    /// 投票
    /// </summary>
    public class VUvote
    {
        /// <summary>
        /// 获取页面数据(单例)
        /// </summary>
        public static GetViewData getViewData;

        /// <summary>
        /// 判断网络连接
        /// </summary>
        public static IsConnect isConnect;
        /// <summary>
        /// 随机生成随机用户名，密码，邮箱，电话，QQ号，性别，年龄,姓名，身份证号码(单例)
        /// </summary>
        public static IRandData irandData;

        /// <summary>
        /// 投票相关的数
        /// </summary>
        public static VoteCount voteCount;

        /// <summary>
        /// HttpClient
        /// </summary>
        public HttpClient httpClient;

        /// <summary>
        /// 地址
        /// </summary>
        public VoteUrl voteUrl;

        static VUvote()
        {
            VUvote.voteCount = new VoteCount();
            VoteLog v = new VoteLog();
            irandData = RandData.GetInstance();
            getViewData = new GetViewData();
            isConnect = new IsConnect();
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="voteUrl"></param>
        /// <param name="voteCount"></param>
        public VUvote(VoteUrl voteUrl)
        {
            this.voteUrl = voteUrl;
            httpClient = new HttpClient(new Uri(voteUrl.AdressVoteShow));
        }
    }
}
